package algorithms.tree;

public class BTree {
    public static void main(String[] args) {
        Node<Integer> five = new Node(5);
        Node<Integer> four = new Node(4);
        Node<Integer> six = new Node(6);
        Node<Integer> one = new Node(1);
        Node<Integer> three = new Node(3);
        Node<Integer> seven = new Node(7);
        Node<Integer> nine = new Node(9);
        Node<Integer> ten = new Node(10);

        // 关系
        five.setLeft(four);
        five.setRight(six);
        four.setLeft(one);
        four.setRight(three);
        six.setLeft(seven);
        six.setRight(nine);
        seven.setLeft(ten);

        BtreeUtils.preorderForeachRecursion(five);
        System.out.println();
        BtreeUtils.preorderForeach(five);
        System.out.println();

    }
}
